package org.scauinfo.fpos.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Saleorderitem entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "saleorderitem", catalog = "db_fpos")
public class Saleorderitem implements java.io.Serializable {

	// Fields

	private Integer id;
	private Saleorder saleorder;
	private Product product;
	private Integer count;
	private Integer state;
	private String description;

	// Constructors

	/** default constructor */
	public Saleorderitem() {
	}

	/** minimal constructor */
	public Saleorderitem(Saleorder saleorder, Product product, Integer count,
			Integer state) {
		this.saleorder = saleorder;
		this.product = product;
		this.count = count;
		this.state = state;
	}

	/** full constructor */
	public Saleorderitem(Saleorder saleorder, Product product, Integer count,
			Integer state, String description) {
		this.saleorder = saleorder;
		this.product = product;
		this.count = count;
		this.state = state;
		this.description = description;
	}

	/**
	 * @param saleorder2
	 * @param product2
	 */
	public Saleorderitem(Saleorder saleorder, Product product) {
		this.saleorder = saleorder;
		this.product = product;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "saleorder_id", referencedColumnName = "saleorder_id", nullable = false)
	public Saleorder getSaleorder() {
		return this.saleorder;
	}

	public void setSaleorder(Saleorder saleorder) {
		this.saleorder = saleorder;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "product_id", referencedColumnName = "product_id", nullable = false)
	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Column(name = "count", nullable = false)
	public Integer getCount() {
		return this.count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	@Column(name = "state", nullable = false)
	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	@Column(name = "description", length = 65535)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

}